
import S3DPath
from S3D import QtHelper
from S3D.Tools.Sound.EventSearcher.MainWindow import *
from S3D.Config import Config

class EventSearcherConfig(Config):
    VERSION = 5
    PATH    = "EventSearcher.config"

    def __init__(self):
        self.workspace      = "Gravitas"
        self.searchSubNames = True
        self.rangeFrom      = 0
        self.rangeToEnable  = True
        self.rangeTo        = -6
        self.rangeParam     = 0
        self.rangeParamsCache   = DEFAULT_RANGES.copy()
        self.selectedProjects   = {} # workspace <-> list of projects
        self.selectedParameters = [
            DEFAULT_NAME_PARAMETERS,
            DEFAULT_PARAM_PARAMETERS,
            DEFAULT_CUSTOM_PARAMETERS,
        ]

        self.customTasks    = []

        self.lastSettingsTab = 0

if __name__ == "__main__":
    QtHelper.ensureSingleApp("SoundEventSearcher")

    cfg = EventSearcherConfig.load()

    wnd = MainWindow(cfg)
    QtHelper.qApp.exec_()

    cfg.save()
